<!--
 * @Date: 2023-02-10 17:15:50
 * @LastEditTime: 2023-02-17 16:00:23
 * @FilePath: /hash-guess-game/src/views/home/safeBox.vue
 * 介绍:保险箱
-->
<script lang="ts" setup>
import router from "@@/router";
import { formatNumber } from "@@/utils/tools/tools";
import { HomeData } from "@@/api/module/home";

const props = defineProps<{
  homeData: HomeData.Res | undefined;
}>();

function onNoBtn() {
  router.push({ name: "drawMoney" });
}
function onOkBtn() {
  router.push({ name: "topUpMoney" });
}
defineExpose({ onNoBtn, onOkBtn });
</script>

<template>
  <div class="safeBox">
    <div class="color-box">
      <div>{{ formatNumber(props.homeData?.vip, 0) }}</div>
      <div>HASH{{ $t("quan-li-shu-liang") }}</div>
    </div>
  </div>
</template>

<style lang="less" scoped>
.safeBox {
  .color-box {
    text-align: center;
    border-radius: 11rem;
    margin: 0 calc(var(--gap-md) * 2);
    padding: var(--gap-md);
    background-color: var(--C-M1);
  }
}
</style>
